package com.luobd.bpm.config;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;

import java.io.IOException;

public class XmlStringDeserializer extends JsonDeserializer<String> {
    @Override
    public String deserialize(JsonParser p, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
        String xmlString = p.getValueAsString();
        // 将转义后的字符（如&quot;）转换回双引号
        xmlString = xmlString.replace("&quot;", "\"");
        return xmlString;
    }
}
